//---------------------------------------------------------------------------

#ifndef TCodeH
#define TCodeH
#include "TDataBase.h"
#define SIZE_CODE 9
#include <TCode.h>

class TCode
{
	public:
		TCode()
		{
			for( int i = 0; i<SIZE_CODE; i++)
			{
				Data[i] = 0;
			}
            Size = 0;
		};
		TCode(int *code)
		{
			for( int i = 0; i<SIZE_CODE; i++)
			{
				Data[i] = 0;
			}
            Size = ( SIZE_CODE>code[0])?code[0]:0;

			for( int i = 1; i<Size && code[i]>0; i++)
			{
				Data[i] = code[i+1];
			}
		};
		TCode(short* code)
		{
			for( int i = 0; i<SIZE_CODE; i++)
			{
				Data[i] = 0;
			}
            Size = (int)( SIZE_CODE>code[0])?code[0]:0;

			for( int i = 0; i<Size && code[i]>0; i++)
			{
				Data[i] = (int)code[i+1];
			}
		};
		TCode(char* code);
		int GetData(int i )
		{
			return  Data[i];
		};
        void operator=(short* code)
        {
			for( int i = 0; i<SIZE_CODE; i++)
			{
				Data[i] = 0;
			}
            Size = (int)( SIZE_CODE>code[0])?code[0]:0;

			for( int i = 0; i<Size && code[i]>0; i++)
			{
				Data[i] = (int)code[i+1];
			}
        };
		int Data[SIZE_CODE];
        int Size;


};
//---------------------------------------------------------------------------
#endif
